UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M9WPK7v3mFCFsHQltSgoXuE9Jiku96EwWoFVk270WhA=' 
WHERE 
  key_id = '26418b127782dbb4a238507ba766174f2ecf0fa136adc422c27490ed6ef7c9ff' 
  AND (
    token = 'M9WPK7v3mFCFsHQltSgoXuE9Jiku96EwWoFVk270WhA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00087