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