UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IpDwEZE6/G8LwoWqNUxE/ei2YHQxeIWPun3u8DnqYA0=' 
WHERE 
  key_id = '1555edf5012f6d8a09fa6490454bc5596621e0ee40ee7d5e552f6832fc87f271' 
  AND (
    token = 'IpDwEZE6/G8LwoWqNUxE/ei2YHQxeIWPun3u8DnqYA0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053