UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wAnE+GXTLhWGGIs/A22+8aTWpfFHMpvMIzi5bdqW0qg=' 
WHERE 
  key_id = 'ffdb83c73e5046117245db3831e0cc878d4f5e72f92310e15321692cba1d78f0' 
  AND (
    token = 'wAnE+GXTLhWGGIs/A22+8aTWpfFHMpvMIzi5bdqW0qg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029