UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N3vvj4x72Em2oNGYAq0D353GfZuGOSpQXTV7Wgr4Q/k=' 
WHERE 
  key_id = '0885c8b505dd16ea78a512401acf9cddbf8fab6943c7c9b972d7923e553b0904' 
  AND (
    token = 'N3vvj4x72Em2oNGYAq0D353GfZuGOSpQXTV7Wgr4Q/k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035