UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w2qjDrO5GEgY8gtGGmBQ2YgrKYYj+TKC56kYHGF6/6I=' 
WHERE 
  key_id = '1dddfc410898a2bed8725c5af36dab28b384ad17b82acbe3f3a18d46bac297a8' 
  AND (
    token = 'w2qjDrO5GEgY8gtGGmBQ2YgrKYYj+TKC56kYHGF6/6I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014