UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dCbhHUVxZ1Kdu5FQzRGyPZ283YWh3rJRp+YhtnNDbRQ=' 
WHERE 
  key_id = '8788644d14bacab98f182e0524502fc4fee97c4f5807d9fd285fba5e1aa0dbb1' 
  AND (
    token = 'dCbhHUVxZ1Kdu5FQzRGyPZ283YWh3rJRp+YhtnNDbRQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042