UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2rf4Ob48CskcKEILfxntFUei4E4NSCaMnRfXee1iBwc='
WHERE
key_id = 'e6f6d155310bbf719fe8ddd82b23a983e4a94943d37e99960c2fc2ce39ddbeda'
AND (
token = '2rf4Ob48CskcKEILfxntFUei4E4NSCaMnRfXee1iBwc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)