UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RUcU6tz3UPilRupNKFhU5tHx5uAW24QOBwBRH7YgGtA=' 
WHERE 
  key_id = '3003afd90695d5530d5244aaca9f80b9e412f65b5fea92a0eddf143e82a16aff' 
  AND (
    token = 'RUcU6tz3UPilRupNKFhU5tHx5uAW24QOBwBRH7YgGtA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023