UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qTRlJ4YTQyK1Ra/j3wrZs3PzDLksO2BXdMsBftUQujA='
WHERE
key_id = '4b86ff0cf74e01cfaec3b4d9393677024cf7d994d7692f1b03421f6dbe9bee57'
AND (
token = 'qTRlJ4YTQyK1Ra/j3wrZs3PzDLksO2BXdMsBftUQujA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)