UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oPHKCZciDFXrUT6Dw02P664dLVXHjOSTYoVnOzMYgyI='
WHERE
key_id = 'dd24c826b201f7bee8f856fdac267248c1844e42e8bbc2a06d130f8846f78780'
AND (
token = 'oPHKCZciDFXrUT6Dw02P664dLVXHjOSTYoVnOzMYgyI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)