UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FjMiqfO79Vldkb1AsuMoYSRAp6FHxiKX8xed79/GpTs=' 
WHERE 
  key_id = '50c5e4177b2308917ebd32ec39dd7bf5f6a3297ae6c7adf02832d3bf7b55107e' 
  AND (
    token = 'FjMiqfO79Vldkb1AsuMoYSRAp6FHxiKX8xed79/GpTs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033