UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dVS47LivbZLIRbkNoFiuh6xvPxcgQ+vZaZYbUydrIkQ='
WHERE
key_id = 'b3a6d5d8e35208bb9b2dd55f10e0d6578b00b20c1a9b2e40638efb0fb784b1c4'
AND (
token = 'dVS47LivbZLIRbkNoFiuh6xvPxcgQ+vZaZYbUydrIkQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)