UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9CsyYEIIMdlbyGinDbzK0oTmf0QFSqIkT6SbZMgpHAA=' 
WHERE 
  key_id = '63565fe291f3d8e564a6bbc8c6f75216b1d8f4128490638dffaf26e475357900' 
  AND (
    token = '9CsyYEIIMdlbyGinDbzK0oTmf0QFSqIkT6SbZMgpHAA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038