UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fMbpmvS5aMy1o3yVb3lRGK3TgmTPDDFnnPmdtAQoHUQ='
WHERE
key_id = '5f5d8becd8b4e069ce032126d9893e00e039b194fe3adcc228ea0ca39118e80b'
AND (
token = 'fMbpmvS5aMy1o3yVb3lRGK3TgmTPDDFnnPmdtAQoHUQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)