UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F7jPiXiJxhJjJ7MWCEFH7LnUbMH7jvYawDnL25bpv9c=' 
WHERE 
  key_id = 'be6869934e89e9830ce6645f66be0ef56b990aa139b9f679e1000e138a568b0e' 
  AND (
    token = 'F7jPiXiJxhJjJ7MWCEFH7LnUbMH7jvYawDnL25bpv9c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033