UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lSe6u/jdewW0TLDS6EDc9TXabFlpHNTiNdD6tldDSXI='
WHERE
key_id = '81656ca7c194fab94ba8813dc602c40abf97186b7e1811268251c933374b2959'
AND (
token = 'lSe6u/jdewW0TLDS6EDc9TXabFlpHNTiNdD6tldDSXI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)