UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'drl4FDRX2yOIUjitHPGjIeSXkNCjWONngavzg5bDlA4='
WHERE
key_id = '13f9f7ab3974555c02f965bcaf1fc529ca8fdbf2935ae4e37ab3a93964d84e0d'
AND (
token = 'drl4FDRX2yOIUjitHPGjIeSXkNCjWONngavzg5bDlA4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)