UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rb8DY5yfNczm757qMdsR1g4mpyOMFKfzmDomQgn/IjI='
WHERE
key_id = 'cad18980c0607566b94574b7411b37c082d2c5ad8bc148b2c36cdee908d7ce7c'
AND (
token = 'Rb8DY5yfNczm757qMdsR1g4mpyOMFKfzmDomQgn/IjI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)