UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a3b2Ib2yzXjfDUSB/OasNJo8tqVZ/J0SbSt6bYhcby8='
WHERE
key_id = '5c18b404d2703e96099b740d2aa04cda57857e387d1555f73bf41b70380f9026'
AND (
token = 'a3b2Ib2yzXjfDUSB/OasNJo8tqVZ/J0SbSt6bYhcby8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)