UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z83FRuj0JPHVUMpCV8T38xm7C26wiIHsIluoYLUjEOg='
WHERE
key_id = '5939f472f158334dbbd101eccce61b50cbbe82db580327bc7ed510d32537060b'
AND (
token = 'z83FRuj0JPHVUMpCV8T38xm7C26wiIHsIluoYLUjEOg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)