UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V6XvwBYO7yJoiyihTIf2o5UDKIxmIA+KvDiP42Fw4Ok='
WHERE
key_id = '492e2f431f3e205c8b98f5ba77235de355fb2c044f05ee39cdc1f6ffbbf6b3b9'
AND (
token = 'V6XvwBYO7yJoiyihTIf2o5UDKIxmIA+KvDiP42Fw4Ok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)