UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iQoJP/BEAxdAVyz0bEndNo1xiNtRux4yWMBEK2rB5d8='
WHERE
key_id = '041fa5e53d7fe391b7ffd790d56738a76adf45b0b7636d95370abea52b008d96'
AND (
token = 'iQoJP/BEAxdAVyz0bEndNo1xiNtRux4yWMBEK2rB5d8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)