UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v+pxfzkiV9IPE6wmhp6ZMj/tD9B+wwco6ZvCPhljpNA=' 
WHERE 
  key_id = 'b669a1a7c102d74d203150a466716ccd548f06a94ffa7867d7268347584e5a71' 
  AND (
    token = 'v+pxfzkiV9IPE6wmhp6ZMj/tD9B+wwco6ZvCPhljpNA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027