UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GMB2edI4NQMOmm0YZos0D7bdpayEcka7hjfljl2DtG8=' 
WHERE 
  key_id = 'fb52624eff8f22dbb241d9c15d9175eb7a9f24a4d9d5ca77a6ff12e80c6bf0af' 
  AND (
    token = 'GMB2edI4NQMOmm0YZos0D7bdpayEcka7hjfljl2DtG8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043