UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S/yusR4MQYo/U4/B0PB8LULDDy2/4Ru/1JUkgGiKDDM=' 
WHERE 
  key_id = 'a00fa49514c93cb24ffc047b2dc73b899214416447141e8ba09627857e5222bf' 
  AND (
    token = 'S/yusR4MQYo/U4/B0PB8LULDDy2/4Ru/1JUkgGiKDDM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034