UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ygh34xWAb2kd3e9OD+Swbla9qrV+VQhGUyQJzOhPWrE=' 
WHERE 
  key_id = 'e5d721ab459f15f3203d6071d2713d139a9e787b12f2bd0be44e174dadb1d6d4' 
  AND (
    token = 'ygh34xWAb2kd3e9OD+Swbla9qrV+VQhGUyQJzOhPWrE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018