UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iIB7XLocvJGJTVg5ogKK07+dQlbiKJbuQOL9GEt+Mek='
WHERE
key_id = 'e379ed84859c05c6cf258b96aaaa7aa60d54d41edeb4c3d33fc7beb6a90e7a52'
AND (
token = 'iIB7XLocvJGJTVg5ogKK07+dQlbiKJbuQOL9GEt+Mek='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)