UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '423g9sTWHt0gfau7xD0xLEWzkCsXtND+ggBbD8XQcyQ=' 
WHERE 
  key_id = '074e500ea6fa7108301ebd8eb78ed914aeaa28a0a1900be3a2277b02fd6e4b1c' 
  AND (
    token = '423g9sTWHt0gfau7xD0xLEWzkCsXtND+ggBbD8XQcyQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019