UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f2PdIxgzM9XIgO0qnGdxghMhxgof8r/2Z/xJiplsfuk='
WHERE
key_id = 'fee90de71837ce16678e54cd726f095186676348b6e0dbcb08d30480e77a4ade'
AND (
token = 'f2PdIxgzM9XIgO0qnGdxghMhxgof8r/2Z/xJiplsfuk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)