UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gC3GaQ+qNDPrIv1815Elxt4+SCI4Jvbp/m0Ma4gn8HQ=' 
WHERE 
  key_id = '54554448ff7b33b5962ba5fae41840db4c7e7a350a3d05a14e8d05b490f9d769' 
  AND (
    token = 'gC3GaQ+qNDPrIv1815Elxt4+SCI4Jvbp/m0Ma4gn8HQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030