UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EbjdjKghXD4L4OFH9KV0KELPlzq+/FJOIgfeRwK0RCQ=' 
WHERE 
  key_id = '32a92be7bf838d80eabd11cd92c3d203b6e3cacf82226ebd468b03604d59ec19' 
  AND (
    token = 'EbjdjKghXD4L4OFH9KV0KELPlzq+/FJOIgfeRwK0RCQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027