UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M7+kS/cXhK+82hqXPVZpg+vjAwwQeHKoqm8FW3a4O6A=' 
WHERE 
  key_id = 'cdf222f09300faa32d68a97526be7db99004ef25ecad52abcc28c7c79d7f68d0' 
  AND (
    token = 'M7+kS/cXhK+82hqXPVZpg+vjAwwQeHKoqm8FW3a4O6A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032